import $store from '@/store'

interface GlobalConfig {
  serveAddress?: string
}

declare const globalConfig: GlobalConfig
declare const process:any

export class BizConfigUtils {
  public static getGlobalConfig () {
    return globalConfig
  }

  public static getLoginUser () {
    console.log(process)
    try {
      const loginUserStr = sessionStorage.getItem('zhtt-login-user')
      if (loginUserStr) {
        return JSON.parse(loginUserStr)
      }
      /* else {
        return { name: '张三', teamName: '开发工作组' }
      } */
      return loginUserStr
    } catch (e) {
      return null
    }
  }

  public static setLoginUser (loginUser: any) {
    sessionStorage.setItem('zhtt-login-user', JSON.stringify(loginUser))
  }
}
